package org.zhs.springframework;

import org.junit.jupiter.api.Test;
import org.zhs.springframework.bean.UserService;

public class test_BeanFactory {

    @Test
    public void test(){
        //1.初始化 BeanFactory接口
        BeanFactory beanFactory = new BeanFactory();

        //2.注册 Bean对象
        BeanDefinition beanDefinition = new BeanDefinition(new UserService());
        beanFactory.registerBeanDefinition("userService", beanDefinition);

        //3.获取 Bean对象
        UserService userService = (UserService)beanFactory.getBean("userService");
        userService.queryUserInfo();
    }
}
